<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%
  String QuanID=request.getParameter("QuanID");
%>
<script>

function getJsonDongtai(quanId){
	 $.ajax({
			url: '/sapfree/servlet/MessageBoradServlet?method=ajaxGetDongtaiByQuanId&QuanId='+quanId, 
			dataType: 'text',
			type: "post",
			error:function(XMLHttpRequest,textStatus,errorThrown){alert(errorThrown);},
			success: function(data) {
			
			     initTableDongtai(data);
			     $("#DongtaiWait").hide();
			}
		});
}

function initTableDongtai(data){
   $('.dongtai').remove();
	data=eval(data);
	
	 var s="";
      for(i=0;i<data.length;i++){
          s+=initTrDongtai(data[i]);
      }   
      $("#dongtaiBorad>tbody").append(s);  
}

function initTrDongtai(dongtai){
	var      qa_activetypecn ,qa_passobjecttitle;     
	 
    
    if(dongtai.qa_passobjecttitle==null){
      qa_passobjecttitle="";
    }
    
    var s="";
    s+=" <tr class=\"dongtai\" ><td class=\"blackNormal12\"></td>";
    s+=" <td height=\"25\" class=\"blackNormal12\"><span class=\"lightBlueNormal12\">";
    
    s+="<a href=\"../personPage/personHome.html\" target=\"_blank\">";
    s+= dongtai.qa_initpersonname+"</a></span> 【";
   
    s+=dongtai.qa_activetypecn+"】";
    
    s+=qa_passobjecttitle+" </td></tr>";
    return s;
}

	function qiandao(){
	       $.ajax({
			url: '/sapfree/servlet/MessageBoradServlet?method=qiaodao', 
			data:{QuanId:'<%=QuanID%>'},
			dataType: 'text',
			type: "post",
			error:function(XMLHttpRequest,textStatus,errorThrown){alert(errorThrown);},
			success: function(data) {
				if(data=="true"){
				 getJsonDongtai('<%=QuanID%>');
				}else{
				   alert("签到未成功，请刷新本页面后重试！");
				}
			}
		});
	}
	
</script>
 
 <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF" id="dongtaiBorad">
            <tr>
              <td width="10" valign="middle" class="userName14">&nbsp;</td>
              <td width="261" height="30" valign="middle" class="userName14">&nbsp;圈子动态</td>
            </tr>
            
		   <tr id="DongtaiWait"> <td width="10" align="right"></td>
		       <td height="30" style="font-size:12px" align=center><img src="../include/images/loading.gif" /> 加载……</td>
		    </tr>
 

     
</table>

 <script>
 getJsonDongtai('<%=QuanID%>');
 </script>